import Vue from 'vue'
import Router from 'vue-router'
import login from '@/components/login'
import index from '@/components/index'
import ceshi from '@/components/ceshi'
import wholeMock from '@/components/simulation/whole'
import mockExam from '@/components/simulation/mockExam'
import ranking from '@/components/simulation/ranking'
import rankTab1 from '@/components/simulation/rankTab1'
import rankTab2 from '@/components/simulation/rankTab2'
import rankTab3 from '@/components/simulation/rankTab3'
import rankTab4 from '@/components/simulation/rankTab4'
import resultExam from '@/components/simulation/resultExam'
import itemBank from '@/components/simulation/itemBank'
import wholeKing from '@/components/ranking/wholeKing'
import tabs1 from '@/components/ranking/tabs1'
import tabs2 from '@/components/ranking/tabs2'
import tabs3 from '@/components/ranking/tabs3'
import tabs4 from '@/components/ranking/tabs4'

import wholeCenter from '@/components/personalCenter/wholeCenter'
import centerRecord from '@/components/personalCenter/centerRecord'
import centerTopic from '@/components/personalCenter/centerTopic'
import record from '@/components/personalCenter/record'
import certificate from '@/components/personalCenter/certificate'
import exaemination from '@/components/personalCenter/exaemination'

import wholeExam from '@/components/exam/examWhole'
import exam from '@/components/exam/exam'
import result from '@/components/exam/result'

Vue.use(Router)

export default new Router({
  // mode:"history",
  // base:'/dist',
  routes: [
    {
      path: '/',
      name: 'index',
      component:index
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/wholeExam',
      name: 'wholeExam',
      component: wholeExam,
      // meta: {requireAuth: true},
      children: [
        {
          path: '/exam',
          name: 'exam',
          component: exam
        },
        {
          path: '/result',
          name: 'result',
          component: result
        },
      ]},
    {
      path: '/index',
      name: 'index',
      component: index
    },
    {
      path: '/ceshi',
      name: 'ceshi',
      component: ceshi
    },
    {
      path: '/wholeMock',
      name: 'wholeMock',
      component: wholeMock,
      // meta: {requireAuth: true},
      children: [
        {
          path: '/',
          redirect: 'mockExam',
        },
        {
          path: 'mockExam',
          name: 'mockExam',
          component: mockExam,
        },
        {
          path: 'ranking',
          name: 'ranking',
          component: ranking,
          children: [
            {
              path: '/',
              name: 'rankTab1',
              redirect: 'rankTab1',
            },
            {
              path: 'rankTab1',
              name: 'rankTab1',
              component: rankTab1,
            },
            {
              path: 'rankTab2',
              name: 'rankTab2',
              component: rankTab2,
            },
            {
              path: 'rankTab3',
              name: 'rankTab3',
              component: rankTab3,
            },
            {
              path: 'rankTab4',
              name: 'rankTab4',
              component: rankTab4,
            },
          ]
        },
        {
          path: 'resultExam',
          name: 'resultExam',
          component: resultExam,
        },
        {
          path: 'itemBank',
          name: 'itemBank',
          component: itemBank,
        },
      ]
    },
    {
      path: '/wholeCenter',
      name: 'wholeCenter',
      component: wholeCenter,
      // meta: {requireAuth: true},
      children: [
        {
          path: '/',
          redirect: 'centerRecord',
        },
        {
          path: 'centerRecord',
          name: 'centerRecord',
          component: centerRecord,
        },
        {
          path: 'centerTopic',
          name: 'centerTopic',
          component: centerTopic,
        },
        {
          path: 'record',
          name: 'record',
          component: record,
        },
        {
          path: 'certificate',
          name: 'certificate',
          component: certificate,
        },
        {
          path: 'exaemination',
          name: 'exaemination',
          component: exaemination,
        },
      ]
    },
    {
      path: '/wholeKing',
      name: 'wholeKing',
      component: wholeKing,
      children: [
        {
          path: '/',
          redirect: 'tabs1',
        },
        {
          path: 'tabs1',
          name: 'tabs1',
          component: tabs1,
        },
        {
          path: 'tabs2',
          name: 'tabs2',
          component: tabs2,
        },
        {
          path: 'tabs3',
          name: 'tabs3',
          component: tabs3,
        },
        {
          path: 'tabs4',
          name: 'tabs4',
          component: tabs4,
        },
      ]
    }

  ]
})
